﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Content.Master" Inherits="System.Web.Mvc.ViewPage<MethodWorx.CMS.UI.Areas.Administration.Models.ExportModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	MethodWorx CMS - Export
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script language="javascript">
        $(document).ready(function () {
            $("#Filter").change(function () {
                $(this).parents("form").submit();
            });
        });
    </script>
    <h2>Export</h2>
    <%using(Html.BeginForm()) { %>
    <div class="formItem">
        <label>Apply Filter</label><%=Html.DropDownList("Filter", this.Model.GetFilterSelectList(), "-- No Filter -- ")%> <em>Caution: Selected Items may be hidden from view</em>
    </div>
    <table class="table">
        <thead>
            <tr>
                <td></td>
                <td></td>
                <td>Object Type</td>
                <td>Object Name</td>
                <td>Object Path</td>
                <td>Import Behavior</td>
            </tr>
        </thead>
        <tbody>
            <%foreach(var o in this.Model.Objects.Where(o => this.Model.Filter == null || this.Model.Filter == o.Type)) { %>
                <tr>
                    <td><input type="checkbox" /></td>
                    <td><img src="/Images/entities/<%=o.Type %>.png" /></td>
                    <td><%=o.Type %></td>
                    <td><%=o.Name %></td>
                    <td><%=o.Path %></td>
                    <td><%=o.ImportBehavior %></td>

                </tr>
            <%} %>
        </tbody>
    </table>
    <%} %>

</asp:Content>
